<?php
class Mail extends Model {
	function Mail() {
		parent::Model();
	}
	function config_mail() {
		$this->load->library('email');
		$config['protocol'] = 'mail';
		$config['smtp_host'] = 'smtp.gmail.com';
		$config['smtp_port'] = 465;
		$config['smtp_user'] = 'siteonline09@gmail.com';
		$config['smtp_pass'] = '..';
		$config['priority'] = 1;
		$config['mailtype'] = 'text';
		$config['charset'] = 'utf-8';
		$config['wordwrap'] = TRUE;

		$this->email->initialize($config);
	}
	
	function send_by_ticket() {
		$from_mail = 'alfin@gamil.com';
		$from_name = 'Alfin';
		$to = 'alfinfanther@yahoo.co.id';
		$cc ='';
		$subject = 'konfirmasi email';
		$message = 'nyampai gak';
		
		$this->email->from($from_mail,$from_name);
		$this->email->to($to);
		$this->email->cc($cc);
		$this->email->subject($subject);
		$this->email->message($message);
		$this->email->send();

		$this->email->print_debugger();
	}
	function resetPass() {
		$from_mail = 'alfin@gamil.com';
		$from_name = 'Alfin';
		$to = 'alfinfanther@yahoo.co.id';
		$cc ='';
		$subject = 'konfirmasi reset password';
		$message = 'Password baru anda adalah "l0g1n" , secepatnya ganti password anda';
		
		$this->email->from($from_mail,$from_name);
		$this->email->to($to);
		$this->email->cc($cc);
		$this->email->subject($subject);
		$this->email->message($message);
		$this->email->send();

		$this->email->print_debugger();
	}
	
} 
?>